      SUBROUTINE QUIKVIS5B1A(T1,T50,VISTIMES,TARGPARM)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C THIS ROUTINE IS PART OF THE QUIKVIS PROGRAM.  IT GIVES THE GRID OF
C AVAILABILITY TIMES FOR THE SURVEY OPTION.
C
C >>  FOR ALL DATES IN THE T1-TO-T50 SPAN, MINIMUM AVAILABILITY
C     DURATIONS PER ORBIT HAVE BEEN GATHERED FOR ALL TARGETS ON THE
C     GRID AND ALL RAAN'S AND DATES OF INTEREST.  GIVE THE RESULTS SO
C     FAR IN GRID FORMAT.
C
C VARIABLE      DIM       TYPE I/O DESCRIPTION
C --------      ---       ---- --- -----------
C
C T1             1         R*8  I  THE FIRST TIME IN THE SPAN. IN
C                                  SECONDS SINCE 1950.0
C
C T50            1         R*8  I  END TIME IN THE SPAN. IN SECONDS
C                                  SINCE 1950.0
C
C VISTIMES    MAXTARGS     R*8  I  THE DURATION PER ORBIT(ALL NODES
C                                  CONSIDERED) THAT A TARGET IS AVAIL.
C                                  MAX BE FOR A SINGLE TIME OR RANGE OF
C                                  TIMES, DEPENDING ON T1 VALUE. SEE
C                                  QUIKVIS5B FOR BETTER DESCRIPTION.
C                                  IN SECONDS.
C
C TARGPARM NPARMS,MAXTARGS R*8  I  DESCRIBED IN QUIKVIS(=MAIN) PROLOGUE.
C
C***********************************************************************
C
C BY C PETRUZZO/GFSC/742.   2/86.
C       MODIFIED....
C
C***********************************************************************
C
C
      INCLUDE 'QUIKVIS.INC'
C
      REAL*8 TARGPARM(NPARMS,MAXTARGS)
      REAL*8 VISTIMES(MAXTARGS)
C
      CHARACTER*2 CHTIMES(NRASURVEY),I4CHAR
      CHARACTER*18 DATETIME
      CHARACTER*20 CH1,CH2
C
C
C
C *************************
C *  PRINT THE TIME GRID  *
C *************************
C
      WRITE(LUPRINT,1000) DATETIME(0)
C
C PRINT THE DECLINATION VALUE AND TIME INFO FOR THAT DECL AN ALL RACN'S
C
      DO IDEC=1,NDECSURVEY
        INDEX1 = (IDEC-1)*NRASURVEY + 1
        DO IRA=1,NRASURVEY
          DUR = VISTIMES(INDEX1-1+IRA)
          KTEMP = JIDINT(DUR/60.D0)
          CHTIMES(IRA) = I4CHAR(KTEMP,2,KDUM)
          IF(DUR.EQ.0.D0) CHTIMES(IRA) = '--'
          END DO
        WRITE(LUPRINT,1003) JIDNNT( TARGPARM(2,INDEX1)*DEGRAD ),
     *           (CHTIMES(I),I=1,NRASURVEY)
        END DO
C
C LABEL THE RACN'S.
C
      WRITE(LUPRINT,1005) ('*',J=1,NRASURVEY,2)
      WRITE(LUPRINT,1004) (JIDNNT(TARGPARM(1,J)*DEGRAD),J=1,NRASURVEY,2)
      WRITE(LUPRINT,1006)
C
C
C GIVE MISC DATA.
C
      CALL QUIKVIS5B1X(1,T1,T50)
C
C PUT OUT THE DATE INFO AGAIN IN A MORE EASILY VISIBLE FORMAT
C
      IF(T1.EQ.T50) THEN
        CALL PAKT50CH(T1,CH1)
        WRITE(LUPRINT,1007) CH1(1:8)
      ELSE
        CALL PAKT50CH(T1,CH1)
        CALL PAKT50CH(T50,CH2)
        WRITE(LUPRINT,1008) CH1(1:8),CH2(1:8)
        END IF
C
C
      RETURN
C
C***********************************************************************
C
C
C**** INITIALIZATION CALL. PUT GLOBAL PARAMETER VALUES INTO THIS
C     ROUTINE'S LOCAL VARIABLES.
C
      ENTRY QVINIT5B1A
C
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      RETURN
C
C***********************************************************************
C
 1000 FORMAT('1',T80,'GENERATED ',A///)
 1003 FORMAT(1X,I3,'>',<NRASURVEY>(1X,A)/)
 1004 FORMAT(5X,<NRASURVEY>(I3,3X))
 1005 FORMAT(5X,<NRASURVEY>(2X,A,3X))
 1006 FORMAT(/////)
 1007 FORMAT(/////,T40,'***** SINGLE DATE *****    DATE=',A)
 1008 FORMAT(/////,
     *      T40,'***** SPANS MULTIPLE DATES *****    ',A,'  THRU  ',A)
      END
